/*带有继承结构的标准Javabean类
1.经理
成员变量:工号，姓名，工资，管理奖金
成员方法:工作(管理其他人)，吃饭(吃米饭)
2.厨师
成员变量:工号，姓名，工资
成员方法:工作(炒菜)，吃饭(吃米饭)
*/
public class A47{
	public static void main(String[] args){
		Manager m1 = new Manager("heima001","xiaozhang",6000.0,2000.0);
		Manager m2 = new Manager();
		m2.setID("heima002");
		m2.setName("xiaowang");
		m2.setSalary(7000.0);
		m2.setBonus(3000.0);
		Cook c1 = new Cook("heima003","dali",4000.0);
		Cook c2 = new Cook();
		c2.setID("heima004");
		c2.setName("dawu");
		c2.setSalary(5000.0);
		System.out.println(m1.getID()+","+m1.getName()+","+m1.getSalary()+","+m1.getBonus());//heima001,xiaozhang,6000.0,2000.0
		m1.work();//经理在管理其他人
		m1.eat();//正在吃米饭
		System.out.println(m2.getID()+","+m2.getName()+","+m2.getSalary()+","+m2.getBonus());//heima002,xiaowang,7000.0,3000.0
		m2.work();//经理在管理其他人
		m2.eat();//正在吃米饭
		System.out.println(c1.getID()+","+c1.getName()+","+c1.getSalary());//heima003,dali,4000.0
		c1.work();//厨师正在炒菜
		c1.eat();//正在吃米饭
		System.out.println(c2.getID()+","+c2.getName()+","+c2.getSalary());//heima004,dawu,5000.0
		c2.work();//厨师正在炒菜
		c2.eat();//正在吃米饭
	}
}
class Employee{
	private String ID;
	private String name;
	private double salary;
	public Employee(){}
	public Employee(String ID,String name,double salary){
		this.ID = ID;
		this.name = name;
		this.salary = salary;
	}
	public String getID(){
		return ID;
	}
	public void setID(String ID){
		this.ID = ID;
	}
	public String getName(){
		return name;
	}
	public void setName(String name){
		this.name = name;
	}
	public double getSalary(){
		return salary;
	}
	public void setSalary(double salary){
		this.salary = salary;
	}
	public void work(){
		System.out.println("正在工作");
	}
	public void eat(){
		System.out.println("正在吃米饭");
	}
}
class Manager extends Employee{
	private double bonus;
	public Manager(){}
	public Manager(String ID,String name,double salary,double bonus){
		super(ID,name,salary);
		this.bonus = bonus;
	}
	public double getBonus(){
		return bonus;
	}
	public void setBonus(double bonus){
		this.bonus = bonus;
	}
	@Override
	public void work(){
		System.out.println("经理在管理其他人");
	}
}
class Cook extends Employee{
	public Cook(){}
	public Cook(String ID,String name,double salary){
		super(ID,name,salary);
	}
	@Override
	public void work(){
		System.out.println("厨师正在炒菜");
	}
}

